package 题目集.dfs.记忆化搜索;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.StringTokenizer;

public class 那就别担心了 {

    static List<Integer>[] map;
    static int[] dp;
    static boolean fit = true;

    public static void main(String[] args) {
        Reader sc = new Reader();
        int n = sc.nextInt();
        int m = sc.nextInt();
        map = new List[n + 1];
        dp = new int[n + 1];
        Arrays.fill(dp, -1);
        for (int i = 1; i <= n; i++) {
            map[i] = new LinkedList<>();
        }
        while (m-- > 0) {
            map[sc.nextInt()].add(sc.nextInt());
        }
        int from = sc.nextInt();
        int to = sc.nextInt();
        int count = path(from, to);
        System.out.print(count + " ");
        if (fit) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }

    public static int path(int s, int e) {
        if (dp[s] != -1) {
            return dp[s];
        }
        if (s == e) {
            dp[s] = 1;
            return dp[s];
        }
        dp[s] = 0;
        if (map[s].isEmpty()) {  //无法往下走了
            fit = false;
            return dp[s];
        }
        for (Integer next : map[s]) {
            dp[s] += path(next, e);
        }
        return dp[s];
    }

    static
    class Reader {
        private BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        private StringTokenizer tokenizer = new StringTokenizer("");

        private String innerNextLine() {
            try {
                return reader.readLine();
            } catch (IOException ex) {
                return null;
            }
        }

        public boolean hasNext() {
            while (!tokenizer.hasMoreTokens()) {    //内存中没有
                String nextLine = innerNextLine();
                if (nextLine == null) {     //且没有下一行
                    return false;
                }
                tokenizer = new StringTokenizer(nextLine);  //读入一行
            }
            return true;
        }

        public String nextLine() {
            tokenizer = new StringTokenizer("");    //清空内存中的字符
            return innerNextLine();
        }

        public void clear() {
            tokenizer = new StringTokenizer("");
        }

        public String next() {
            hasNext();
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
//    public BigInteger nextBigInt() {
//        return new BigInteger(next());
//    }
    }

}

